package com.loan.controller.common;

import com.alibaba.fastjson.JSONObject;
import com.loan.common.core.domain.Result;
import com.loan.common.pay.hqpay.HQPayUtils;
import com.loan.system.domain.vo.PaymentCallbackVo;
import com.loan.system.service.ApplyService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author shiguang on 2022/9/22 15:27
 */
@Api(value = "oddpay代收管理", tags = {"oddpay代收管理"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/oddpay")
public class OddPayController {

    private final ApplyService applyService;

    /**
     * 代收回调
     * @return
     */
    @PostMapping("/payment/callback")
    public String paymentCallBack(HttpServletRequest request){
//        String orderId = request.getParameter("odderId");
//        String receiveTime = request.getParameter("receiveTime");
//        String completeTime = request.getParameter("completeTime");
//        String completeTime = request.getParameter("amount");
//        String completeTime = request.getParameter("txnId");
//        String completeTime = request.getParameter("signInfo");
//        String completeTime = request.getParameter("merchId");
//        String completeTime = request.getParameter("retCode");
//        String completeTime = request.getParameter("merchId");
//        String completeTime = request.getParameter("status");

//        return "success";
        return applyService.updateApplyByMsg(request);
    }

}
